<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="/resources/tpl/pageCorpsTemplate.xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:etsmtl="http://java.sun.com/jsf/composite/etsmtl"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:f="http://java.sun.com/jsf/core">


    <ui:define name="content">
        <h:form id="formPanier" > <br/>

            <p:panel id="panelPanierCompte" header="#{bundle.v_pageCart_panelPanierCompte_header_msg1} #{panierCtrl.count}"  rendered="true" toggleable="true" >       
                <div style="overflow: auto">
                    <p:dataTable id="tableVar" var="item" value="#{panierCtrl.cacheSessionPresentation.representationSelected}" widgetVar="LaTable" paginator="true" rows="5"
                                 emptyMessage="#{bundle.v_pageCart_panelPanierCompte_header_emptyMessage}" rowKey="#{item}"
                                 editable="true" selectionMode="single"
                                 paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                                 rowsPerPageTemplate="5,10,15,25" >                  

                        <f:facet name="header" >          
                            <table border="0" >
                                <tr style="border-style: hidden;">
                                    <td align="left" width="125px" style="white-space: nowrap;">#{bundle.v_pageCart_panelPanierCompte_header_Message}</td>
                                    <td style="border-style: hidden;" align="left" width="20px" ><p:ajaxStatus style="width:16px;height:16px;" id="ajaxStatusPanel" > <f:facet name="#{bundle.v_pageCart_panelPanierCompte_message_start}"><h:graphicImage value="/resources/etsmtl/img/ajaxLoader1.gif" alt="#{bundle.v_pageCheckout_waiting_Message}" /> </f:facet> <f:facet name="#{bundle.v_pageCheckout_complete_loading_Message}"> <h:outputText value="" /> </f:facet> </p:ajaxStatus></td>
                                    <td align="right"><h:outputText value=" #{bundle.v_pageCheckout_searchfield_label} " /><p:inputText id="globalFilter" onkeyup="LaTable.filter()" size="23" /> <p:watermark for="globalFilter" value="#{bundle.v_pageCheckout_searchfield_defaultText}" /></td>
                                </tr>
                            </table>
                        </f:facet>

                        <!--<composite:insertChildren id="colonneTableCrud" />-->
                        <p:column headerText="#{bundle.p_Artiste_headerText}" filterBy="#{panierCtrl.cacheSessionPresentation.spectacleSelected.artiste.nom}" sortBy="#{panierCtrl.cacheSessionPresentation.spectacleSelected.artiste.lienPhoto}" >
                            <h:outputLabel value="#{panierCtrl.cacheSessionPresentation.spectacleSelected.artiste.nom}"  />
                        </p:column>

                        <p:column headerText="#{bundle.p_Qte_billets_headerText}"  >
                            <h:outputLabel value="#{item.QTE}"  /> 
                        </p:column>

                        <p:column headerText="#{bundle.p_Spectacle_headerText}" filterBy="#{panierCtrl.cacheSessionPresentation.spectacleSelected.nomSpectacle}" sortBy="#{panierCtrl.cacheSessionPresentation.spectacle.nomSpectacle}" >
                            <h:outputLabel value="#{panierCtrl.cacheSessionPresentation.spectacleSelected.nomSpectacle}"  />  
                        </p:column>

                        <p:column headerText="#{bundle.p_Ville_headerText}" filterBy="#{item.salle.adresse}" sortBy="#{item.salle.adresse}" >
                            <h:outputLabel value="#{item.salle.adresse}"  />  
                        </p:column>

                        <p:column headerText="#{bundle.p_dateDebutColumn_headerText}" filterBy="#{item.dateDebut}" sortBy="#{item.dateDebut}" >
                            <etsmtl:outputCalendar valeur="#{item.dateDebut}" />  
                        </p:column>

                       <!-- <p:column headerText="#{bundle.v_pageCart_panelPanierCompte_starthour}" filterBy="#{item.dateDebut.hours}:#{item.dateDebut.minutes}" sortBy="#{item.dateDebut.hours}:#{item.dateDebut.minutes}" >
                            <h:outputLabel value="#{item.dateDebut.hours}:#{item.dateDebut.minutes}" />  
                        </p:column> -->

                        <p:column headerText="#{bundle.v_pageCart_panelPanierCompte_details}" style="width: 40px;" >                                            
                            <p:commandButton id="actionOnDetails" disabled="false" global="false" update=":formPanier:mydialog:documentPanel" immediate="true" oncomplete="documentDialog.show()" actionListener="#{panierCtrl.onDetailsEnregistrement(item)}" title="#{bundle.v_pageCart_panelPanierCompte_show_details_msg}" icon="ui-icon-zoomin" />
                        </p:column>
                       
                        <f:facet name="footer"> 
                            <p:button outcome="pageCheckout" value="#{bundle.v_pageCart_panelPanierCompte_buybutton}" icon="ui-icon-suitcase" ></p:button> <p:spacer width="40px"/>
                            <p:commandButton value="#{bundle.v_pageCart_panelPanierCompte_add_to_cart} ( #{panierCtrl.count} )" actionListener="#{panierCtrl.increment}" disabled="#{cacheSessionPresentationCtrl.disablePanier}" update="@this :formPanier:panelPanierCompte" icon="ui-icon-cart" /> <p:spacer width="40px"/> 
                            <p:button type="reset" value="#{bundle.p_resetButton_value}" icon="ui-icon-cancel" ></p:button>                   
                        </f:facet>

                    </p:dataTable>
                </div>

                <etsmtl:dialogDetails id="mydialog" >

                </etsmtl:dialogDetails>


                <p:blockUI block="tableVar" trigger="tableVar">  
                    LOADING<br />  
                    <p:graphicImage value="/resources/etsmtl/img/ajaxLoader5.gif"/>  
                </p:blockUI>             
            </p:panel>


        </h:form>

    </ui:define>


</ui:composition>
